package src.itheima04;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;

public class A {
    public static void main(String[] args) {
        HashSet<Student>hashSet=new HashSet();

        hashSet.add(new Student("12",10));
        hashSet.add(new Student("20",20));
        hashSet.add(new Student("20",20));
        hashSet.add(new Student("18",12));

        System.out.println("---------------");

         Iterator<Student>iterator=hashSet.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
        System.out.println("-----------");
        for (Student student : hashSet) {
            System.out.println(student);
        }
    }
}
